package tgc.edu.tms.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

import tgc.edu.tms.custom.CommonService;
import tgc.edu.tms.entity.SysUser;
import tgc.edu.tms.entity.TtbRecord;
import tgc.edu.tms.repository.TtbRecordRepository;

@Service
public class TtbRecordService extends CommonService<TtbRecord, Integer>{
	@Autowired
	private TtbRecordRepository ttb_RecordDAO;

	public List<TtbRecord> findByUserId(Integer id, Sort sort) {
		return ttb_RecordDAO.findByUserId(id, sort);
	}

	public List<TtbRecord> findByUserAndTypeTwoAndState(SysUser user, String string, String string2) {
		return ttb_RecordDAO.findByUserAndTypeTwoAndState(user,string,string2);
	}

	public List<TtbRecord> findByType(String string) {
		
		return ttb_RecordDAO.findByType(string);
	}

	public List<TtbRecord> findByTypeAndState(String string, String string2) {
		
		return ttb_RecordDAO.findByTypeAndState(string,string2);
	}

	public List<TtbRecord> findByTeacherAndSuspendTime(String username1, String day1) {
		return ttb_RecordDAO.findByTeacherAndSuspendTime(username1,day1);
	}

	public TtbRecord findByUserAndSuspendTimeAndSection(SysUser user, String suspendTime, String section) {
		return ttb_RecordDAO.findByUserAndSuspendTimeAndSection(user, suspendTime, section);
	}

	public TtbRecord findByUserAndSuspendTimeAndSectionAndTypeTwoIsNull(SysUser user, String suspendTime,
			String section) {
		return ttb_RecordDAO.findByUserAndSuspendTimeAndSectionAndTypeTwoIsNull(user, suspendTime, section);
	}

	public List<TtbRecord> findOpplyTime(String opplyTime, String opplyTime1) {
		return ttb_RecordDAO.findOpplyTime(opplyTime,opplyTime1);
	}

	public Page<TtbRecord> findBytypeCount(PageRequest pageable) {
		return ttb_RecordDAO.findBytypeCount(pageable);
	}

	public List<TtbRecord> findBytypeCount1(String op1, String op2) {
		return ttb_RecordDAO.findBytypeCount1(op1, op2);
	}

	

}
